// $ANTLR 3.0.1 C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g 2008-10-24 10:34:15

  package org.bling.language;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;


import org.antlr.runtime.tree.*;

public class BlingParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "TAG_ATTRIBUTE", "SNIPPET", "TAG_OPENING", "TAG_CLOSING", "TAG_SELF_CLOSING", "TEXT", "ROOT", "LINEEND", "COMMENT_OPEN", "COMMENT_CLOSE", "XML_COMMENT", "WHITESPACE", "COMMAND_OPEN", "COMMAND_CLOSE", "CODE_SNIPPET", "TAG_OPEN", "TAG_CLOSE", "WORD", "STRING_LITERAL", "TAG_SELF_CLOSE", "CLOSING_TAG", "'='"
    };
    public static final int TAG_ATTRIBUTE=4;
    public static final int TAG_CLOSE=20;
    public static final int COMMAND_OPEN=16;
    public static final int SNIPPET=5;
    public static final int COMMENT_OPEN=12;
    public static final int WHITESPACE=15;
    public static final int LINEEND=11;
    public static final int TEXT=9;
    public static final int EOF=-1;
    public static final int ROOT=10;
    public static final int COMMAND_CLOSE=17;
    public static final int TAG_OPEN=19;
    public static final int WORD=21;
    public static final int TAG_SELF_CLOSING=8;
    public static final int CLOSING_TAG=24;
    public static final int XML_COMMENT=14;
    public static final int STRING_LITERAL=22;
    public static final int CODE_SNIPPET=18;
    public static final int TAG_SELF_CLOSE=23;
    public static final int COMMENT_CLOSE=13;
    public static final int TAG_CLOSING=7;
    public static final int TAG_OPENING=6;

        public BlingParser(TokenStream input) {
            super(input);
        }
        
    protected TreeAdaptor adaptor = new CommonTreeAdaptor();

    public void setTreeAdaptor(TreeAdaptor adaptor) {
        this.adaptor = adaptor;
    }
    public TreeAdaptor getTreeAdaptor() {
        return adaptor;
    }

    public String[] getTokenNames() { return tokenNames; }
    public String getGrammarFileName() { return "C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g"; }


    public static class bling_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start bling
    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:52:1: bling : ( statement )* -> ^( ROOT ( statement )* ) ;
    public final bling_return bling() throws RecognitionException {
        bling_return retval = new bling_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        statement_return statement1 = null;


        RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
        try {
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:52:8: ( ( statement )* -> ^( ROOT ( statement )* ) )
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:52:10: ( statement )*
            {
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:52:10: ( statement )*
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( ((LA1_0>=CODE_SNIPPET && LA1_0<=TAG_OPEN)||LA1_0==WORD||LA1_0==CLOSING_TAG) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:52:10: statement
            	    {
            	    pushFollow(FOLLOW_statement_in_bling324);
            	    statement1=statement();
            	    _fsp--;

            	    stream_statement.add(statement1.getTree());

            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);


            // AST REWRITE
            // elements: statement
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 52:21: -> ^( ROOT ( statement )* )
            {
                // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:52:24: ^( ROOT ( statement )* )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(ROOT, "ROOT"), root_1);

                // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:52:31: ( statement )*
                while ( stream_statement.hasNext() ) {
                    adaptor.addChild(root_1, stream_statement.next());

                }
                stream_statement.reset();

                adaptor.addChild(root_0, root_1);
                }

            }



            }

            retval.stop = input.LT(-1);

                retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end bling

    public static class statement_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start statement
    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:54:1: statement : ( tag | text );
    public final statement_return statement() throws RecognitionException {
        statement_return retval = new statement_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        tag_return tag2 = null;

        text_return text3 = null;



        try {
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:54:11: ( tag | text )
            int alt2=2;
            int LA2_0 = input.LA(1);

            if ( ((LA2_0>=CODE_SNIPPET && LA2_0<=TAG_OPEN)||LA2_0==CLOSING_TAG) ) {
                alt2=1;
            }
            else if ( (LA2_0==WORD) ) {
                alt2=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("54:1: statement : ( tag | text );", 2, 0, input);

                throw nvae;
            }
            switch (alt2) {
                case 1 :
                    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:54:13: tag
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    pushFollow(FOLLOW_tag_in_statement342);
                    tag2=tag();
                    _fsp--;

                    adaptor.addChild(root_0, tag2.getTree());

                    }
                    break;
                case 2 :
                    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:54:19: text
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    pushFollow(FOLLOW_text_in_statement346);
                    text3=text();
                    _fsp--;

                    adaptor.addChild(root_0, text3.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);

                retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end statement

    public static class text_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start text
    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:56:1: text : ( WORD )+ -> ^( TEXT ( WORD )+ ) ;
    public final text_return text() throws RecognitionException {
        text_return retval = new text_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token WORD4=null;

        CommonTree WORD4_tree=null;
        RewriteRuleTokenStream stream_WORD=new RewriteRuleTokenStream(adaptor,"token WORD");

        try {
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:56:6: ( ( WORD )+ -> ^( TEXT ( WORD )+ ) )
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:56:8: ( WORD )+
            {
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:56:8: ( WORD )+
            int cnt3=0;
            loop3:
            do {
                int alt3=2;
                int LA3_0 = input.LA(1);

                if ( (LA3_0==WORD) ) {
                    alt3=1;
                }


                switch (alt3) {
            	case 1 :
            	    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:56:8: WORD
            	    {
            	    WORD4=(Token)input.LT(1);
            	    match(input,WORD,FOLLOW_WORD_in_text354); 
            	    stream_WORD.add(WORD4);


            	    }
            	    break;

            	default :
            	    if ( cnt3 >= 1 ) break loop3;
                        EarlyExitException eee =
                            new EarlyExitException(3, input);
                        throw eee;
                }
                cnt3++;
            } while (true);


            // AST REWRITE
            // elements: WORD
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 56:14: -> ^( TEXT ( WORD )+ )
            {
                // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:56:17: ^( TEXT ( WORD )+ )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(TEXT, "TEXT"), root_1);

                if ( !(stream_WORD.hasNext()) ) {
                    throw new RewriteEarlyExitException();
                }
                while ( stream_WORD.hasNext() ) {
                    adaptor.addChild(root_1, stream_WORD.next());

                }
                stream_WORD.reset();

                adaptor.addChild(root_0, root_1);
                }

            }



            }

            retval.stop = input.LT(-1);

                retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end text

    public static class tag_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start tag
    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:58:1: tag : ( opening_tag | closing_tag | code_snippet );
    public final tag_return tag() throws RecognitionException {
        tag_return retval = new tag_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        opening_tag_return opening_tag5 = null;

        closing_tag_return closing_tag6 = null;

        code_snippet_return code_snippet7 = null;



        try {
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:58:5: ( opening_tag | closing_tag | code_snippet )
            int alt4=3;
            switch ( input.LA(1) ) {
            case TAG_OPEN:
                {
                alt4=1;
                }
                break;
            case CLOSING_TAG:
                {
                alt4=2;
                }
                break;
            case CODE_SNIPPET:
                {
                alt4=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("58:1: tag : ( opening_tag | closing_tag | code_snippet );", 4, 0, input);

                throw nvae;
            }

            switch (alt4) {
                case 1 :
                    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:58:7: opening_tag
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    pushFollow(FOLLOW_opening_tag_in_tag372);
                    opening_tag5=opening_tag();
                    _fsp--;

                    adaptor.addChild(root_0, opening_tag5.getTree());

                    }
                    break;
                case 2 :
                    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:59:11: closing_tag
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    pushFollow(FOLLOW_closing_tag_in_tag386);
                    closing_tag6=closing_tag();
                    _fsp--;

                    adaptor.addChild(root_0, closing_tag6.getTree());

                    }
                    break;
                case 3 :
                    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:60:11: code_snippet
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    pushFollow(FOLLOW_code_snippet_in_tag400);
                    code_snippet7=code_snippet();
                    _fsp--;

                    adaptor.addChild(root_0, code_snippet7.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);

                retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end tag

    public static class opening_tag_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start opening_tag
    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:62:1: opening_tag : TAG_OPEN WORD ( attributes )? ( TAG_CLOSE -> ^( TAG_OPENING WORD ( attributes )? ) | TAG_SELF_CLOSE -> ^( TAG_SELF_CLOSING WORD ( attributes )? ) ) ;
    public final opening_tag_return opening_tag() throws RecognitionException {
        opening_tag_return retval = new opening_tag_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token TAG_OPEN8=null;
        Token WORD9=null;
        Token TAG_CLOSE11=null;
        Token TAG_SELF_CLOSE12=null;
        attributes_return attributes10 = null;


        CommonTree TAG_OPEN8_tree=null;
        CommonTree WORD9_tree=null;
        CommonTree TAG_CLOSE11_tree=null;
        CommonTree TAG_SELF_CLOSE12_tree=null;
        RewriteRuleTokenStream stream_WORD=new RewriteRuleTokenStream(adaptor,"token WORD");
        RewriteRuleTokenStream stream_TAG_CLOSE=new RewriteRuleTokenStream(adaptor,"token TAG_CLOSE");
        RewriteRuleTokenStream stream_TAG_SELF_CLOSE=new RewriteRuleTokenStream(adaptor,"token TAG_SELF_CLOSE");
        RewriteRuleTokenStream stream_TAG_OPEN=new RewriteRuleTokenStream(adaptor,"token TAG_OPEN");
        RewriteRuleSubtreeStream stream_attributes=new RewriteRuleSubtreeStream(adaptor,"rule attributes");
        try {
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:62:13: ( TAG_OPEN WORD ( attributes )? ( TAG_CLOSE -> ^( TAG_OPENING WORD ( attributes )? ) | TAG_SELF_CLOSE -> ^( TAG_SELF_CLOSING WORD ( attributes )? ) ) )
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:62:15: TAG_OPEN WORD ( attributes )? ( TAG_CLOSE -> ^( TAG_OPENING WORD ( attributes )? ) | TAG_SELF_CLOSE -> ^( TAG_SELF_CLOSING WORD ( attributes )? ) )
            {
            TAG_OPEN8=(Token)input.LT(1);
            match(input,TAG_OPEN,FOLLOW_TAG_OPEN_in_opening_tag408); 
            stream_TAG_OPEN.add(TAG_OPEN8);

            WORD9=(Token)input.LT(1);
            match(input,WORD,FOLLOW_WORD_in_opening_tag410); 
            stream_WORD.add(WORD9);

            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:62:29: ( attributes )?
            int alt5=2;
            int LA5_0 = input.LA(1);

            if ( (LA5_0==WORD) ) {
                alt5=1;
            }
            switch (alt5) {
                case 1 :
                    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:62:29: attributes
                    {
                    pushFollow(FOLLOW_attributes_in_opening_tag412);
                    attributes10=attributes();
                    _fsp--;

                    stream_attributes.add(attributes10.getTree());

                    }
                    break;

            }

            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:62:41: ( TAG_CLOSE -> ^( TAG_OPENING WORD ( attributes )? ) | TAG_SELF_CLOSE -> ^( TAG_SELF_CLOSING WORD ( attributes )? ) )
            int alt6=2;
            int LA6_0 = input.LA(1);

            if ( (LA6_0==TAG_CLOSE) ) {
                alt6=1;
            }
            else if ( (LA6_0==TAG_SELF_CLOSE) ) {
                alt6=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("62:41: ( TAG_CLOSE -> ^( TAG_OPENING WORD ( attributes )? ) | TAG_SELF_CLOSE -> ^( TAG_SELF_CLOSING WORD ( attributes )? ) )", 6, 0, input);

                throw nvae;
            }
            switch (alt6) {
                case 1 :
                    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:63:18: TAG_CLOSE
                    {
                    TAG_CLOSE11=(Token)input.LT(1);
                    match(input,TAG_CLOSE,FOLLOW_TAG_CLOSE_in_opening_tag434); 
                    stream_TAG_CLOSE.add(TAG_CLOSE11);


                    // AST REWRITE
                    // elements: attributes, WORD
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 63:28: -> ^( TAG_OPENING WORD ( attributes )? )
                    {
                        // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:63:31: ^( TAG_OPENING WORD ( attributes )? )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(TAG_OPENING, "TAG_OPENING"), root_1);

                        adaptor.addChild(root_1, stream_WORD.next());
                        // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:63:50: ( attributes )?
                        if ( stream_attributes.hasNext() ) {
                            adaptor.addChild(root_1, stream_attributes.next());

                        }
                        stream_attributes.reset();

                        adaptor.addChild(root_0, root_1);
                        }

                    }



                    }
                    break;
                case 2 :
                    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:64:18: TAG_SELF_CLOSE
                    {
                    TAG_SELF_CLOSE12=(Token)input.LT(1);
                    match(input,TAG_SELF_CLOSE,FOLLOW_TAG_SELF_CLOSE_in_opening_tag466); 
                    stream_TAG_SELF_CLOSE.add(TAG_SELF_CLOSE12);


                    // AST REWRITE
                    // elements: attributes, WORD
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 64:33: -> ^( TAG_SELF_CLOSING WORD ( attributes )? )
                    {
                        // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:64:36: ^( TAG_SELF_CLOSING WORD ( attributes )? )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(TAG_SELF_CLOSING, "TAG_SELF_CLOSING"), root_1);

                        adaptor.addChild(root_1, stream_WORD.next());
                        // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:64:60: ( attributes )?
                        if ( stream_attributes.hasNext() ) {
                            adaptor.addChild(root_1, stream_attributes.next());

                        }
                        stream_attributes.reset();

                        adaptor.addChild(root_0, root_1);
                        }

                    }



                    }
                    break;

            }


            }

            retval.stop = input.LT(-1);

                retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end opening_tag

    public static class closing_tag_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start closing_tag
    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:67:1: closing_tag : CLOSING_TAG WORD TAG_CLOSE -> ^( TAG_CLOSING WORD ) ;
    public final closing_tag_return closing_tag() throws RecognitionException {
        closing_tag_return retval = new closing_tag_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token CLOSING_TAG13=null;
        Token WORD14=null;
        Token TAG_CLOSE15=null;

        CommonTree CLOSING_TAG13_tree=null;
        CommonTree WORD14_tree=null;
        CommonTree TAG_CLOSE15_tree=null;
        RewriteRuleTokenStream stream_WORD=new RewriteRuleTokenStream(adaptor,"token WORD");
        RewriteRuleTokenStream stream_CLOSING_TAG=new RewriteRuleTokenStream(adaptor,"token CLOSING_TAG");
        RewriteRuleTokenStream stream_TAG_CLOSE=new RewriteRuleTokenStream(adaptor,"token TAG_CLOSE");

        try {
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:67:13: ( CLOSING_TAG WORD TAG_CLOSE -> ^( TAG_CLOSING WORD ) )
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:67:15: CLOSING_TAG WORD TAG_CLOSE
            {
            CLOSING_TAG13=(Token)input.LT(1);
            match(input,CLOSING_TAG,FOLLOW_CLOSING_TAG_in_closing_tag505); 
            stream_CLOSING_TAG.add(CLOSING_TAG13);

            WORD14=(Token)input.LT(1);
            match(input,WORD,FOLLOW_WORD_in_closing_tag507); 
            stream_WORD.add(WORD14);

            TAG_CLOSE15=(Token)input.LT(1);
            match(input,TAG_CLOSE,FOLLOW_TAG_CLOSE_in_closing_tag509); 
            stream_TAG_CLOSE.add(TAG_CLOSE15);


            // AST REWRITE
            // elements: WORD
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 67:42: -> ^( TAG_CLOSING WORD )
            {
                // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:67:45: ^( TAG_CLOSING WORD )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(TAG_CLOSING, "TAG_CLOSING"), root_1);

                adaptor.addChild(root_1, stream_WORD.next());

                adaptor.addChild(root_0, root_1);
                }

            }



            }

            retval.stop = input.LT(-1);

                retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end closing_tag

    public static class code_snippet_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start code_snippet
    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:69:1: code_snippet : CODE_SNIPPET -> ^( SNIPPET CODE_SNIPPET ) ;
    public final code_snippet_return code_snippet() throws RecognitionException {
        code_snippet_return retval = new code_snippet_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token CODE_SNIPPET16=null;

        CommonTree CODE_SNIPPET16_tree=null;
        RewriteRuleTokenStream stream_CODE_SNIPPET=new RewriteRuleTokenStream(adaptor,"token CODE_SNIPPET");

        try {
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:69:14: ( CODE_SNIPPET -> ^( SNIPPET CODE_SNIPPET ) )
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:69:16: CODE_SNIPPET
            {
            CODE_SNIPPET16=(Token)input.LT(1);
            match(input,CODE_SNIPPET,FOLLOW_CODE_SNIPPET_in_code_snippet526); 
            stream_CODE_SNIPPET.add(CODE_SNIPPET16);


            // AST REWRITE
            // elements: CODE_SNIPPET
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 69:29: -> ^( SNIPPET CODE_SNIPPET )
            {
                // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:69:32: ^( SNIPPET CODE_SNIPPET )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(SNIPPET, "SNIPPET"), root_1);

                adaptor.addChild(root_1, stream_CODE_SNIPPET.next());

                adaptor.addChild(root_0, root_1);
                }

            }



            }

            retval.stop = input.LT(-1);

                retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end code_snippet

    public static class attributes_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start attributes
    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:71:1: attributes : ( attribute )+ ;
    public final attributes_return attributes() throws RecognitionException {
        attributes_return retval = new attributes_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        attribute_return attribute17 = null;



        try {
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:71:12: ( ( attribute )+ )
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:71:14: ( attribute )+
            {
            root_0 = (CommonTree)adaptor.nil();

            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:71:14: ( attribute )+
            int cnt7=0;
            loop7:
            do {
                int alt7=2;
                int LA7_0 = input.LA(1);

                if ( (LA7_0==WORD) ) {
                    alt7=1;
                }


                switch (alt7) {
            	case 1 :
            	    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:71:14: attribute
            	    {
            	    pushFollow(FOLLOW_attribute_in_attributes542);
            	    attribute17=attribute();
            	    _fsp--;

            	    adaptor.addChild(root_0, attribute17.getTree());

            	    }
            	    break;

            	default :
            	    if ( cnt7 >= 1 ) break loop7;
                        EarlyExitException eee =
                            new EarlyExitException(7, input);
                        throw eee;
                }
                cnt7++;
            } while (true);


            }

            retval.stop = input.LT(-1);

                retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end attributes

    public static class attribute_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start attribute
    // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:73:1: attribute : WORD '=' STRING_LITERAL -> ^( TAG_ATTRIBUTE WORD STRING_LITERAL ) ;
    public final attribute_return attribute() throws RecognitionException {
        attribute_return retval = new attribute_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token WORD18=null;
        Token char_literal19=null;
        Token STRING_LITERAL20=null;

        CommonTree WORD18_tree=null;
        CommonTree char_literal19_tree=null;
        CommonTree STRING_LITERAL20_tree=null;
        RewriteRuleTokenStream stream_WORD=new RewriteRuleTokenStream(adaptor,"token WORD");
        RewriteRuleTokenStream stream_STRING_LITERAL=new RewriteRuleTokenStream(adaptor,"token STRING_LITERAL");
        RewriteRuleTokenStream stream_25=new RewriteRuleTokenStream(adaptor,"token 25");

        try {
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:73:11: ( WORD '=' STRING_LITERAL -> ^( TAG_ATTRIBUTE WORD STRING_LITERAL ) )
            // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:73:13: WORD '=' STRING_LITERAL
            {
            WORD18=(Token)input.LT(1);
            match(input,WORD,FOLLOW_WORD_in_attribute552); 
            stream_WORD.add(WORD18);

            char_literal19=(Token)input.LT(1);
            match(input,25,FOLLOW_25_in_attribute554); 
            stream_25.add(char_literal19);

            STRING_LITERAL20=(Token)input.LT(1);
            match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_attribute556); 
            stream_STRING_LITERAL.add(STRING_LITERAL20);


            // AST REWRITE
            // elements: STRING_LITERAL, WORD
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 73:37: -> ^( TAG_ATTRIBUTE WORD STRING_LITERAL )
            {
                // C:\\workspace\\Bling\\src\\org\\bling\\language\\Bling.g:73:40: ^( TAG_ATTRIBUTE WORD STRING_LITERAL )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(TAG_ATTRIBUTE, "TAG_ATTRIBUTE"), root_1);

                adaptor.addChild(root_1, stream_WORD.next());
                adaptor.addChild(root_1, stream_STRING_LITERAL.next());

                adaptor.addChild(root_0, root_1);
                }

            }



            }

            retval.stop = input.LT(-1);

                retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end attribute


 

    public static final BitSet FOLLOW_statement_in_bling324 = new BitSet(new long[]{0x00000000012C0002L});
    public static final BitSet FOLLOW_tag_in_statement342 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_text_in_statement346 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_WORD_in_text354 = new BitSet(new long[]{0x0000000000200002L});
    public static final BitSet FOLLOW_opening_tag_in_tag372 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_closing_tag_in_tag386 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_code_snippet_in_tag400 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_TAG_OPEN_in_opening_tag408 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_WORD_in_opening_tag410 = new BitSet(new long[]{0x0000000000B00000L});
    public static final BitSet FOLLOW_attributes_in_opening_tag412 = new BitSet(new long[]{0x0000000000900000L});
    public static final BitSet FOLLOW_TAG_CLOSE_in_opening_tag434 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_TAG_SELF_CLOSE_in_opening_tag466 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_CLOSING_TAG_in_closing_tag505 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_WORD_in_closing_tag507 = new BitSet(new long[]{0x0000000000100000L});
    public static final BitSet FOLLOW_TAG_CLOSE_in_closing_tag509 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_CODE_SNIPPET_in_code_snippet526 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_attribute_in_attributes542 = new BitSet(new long[]{0x0000000000200002L});
    public static final BitSet FOLLOW_WORD_in_attribute552 = new BitSet(new long[]{0x0000000002000000L});
    public static final BitSet FOLLOW_25_in_attribute554 = new BitSet(new long[]{0x0000000000400000L});
    public static final BitSet FOLLOW_STRING_LITERAL_in_attribute556 = new BitSet(new long[]{0x0000000000000002L});

}